export default (key, name, type) => {
    if (!type) type = "flowable";
    const TYPE_TARGET = {
        activiti: "http://activiti.org/bpmn",
        camunda: "http://camunda.org/schema/1.0/bpmn",
        flowable: "http://flowable.org/bpmn"
    };
    // targetNamespace="${TYPE_TARGET[type]}"
    return `<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
  xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
  xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
  xmlns:flowable="http://flowable.org/bpmn" 
  xmlns:activiti="http://activiti.org/bpmn" 
  xmlns:camunda="http://camunda.org/schema/1.0/bpmn" 
  targetNamespace="http://bpmn.io/schema/bpmn"
  id="diagram_${key}">
  <bpmn:process id="${key}" name="${name}" isExecutable="true">
    <bpmn:startEvent id="StartEvent_1" name="开始" flowable:initiator="initiator">
        <bpmn:outgoing>Flow_03u79xd</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:userTask id="Activity_first_01">
        <bpmn:incoming>Flow_03u79xd</bpmn:incoming>
    </bpmn:userTask>
    <bpmn:sequenceFlow id="Flow_03u79xd" sourceRef="StartEvent_1" targetRef="Activity_first_01" />
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="${key}">
      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
         <dc:Bounds x="252" y="252" width="36" height="36" />
         <bpmndi:BPMNLabel>
           <dc:Bounds x="259" y="295" width="22" height="14" />
         </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_first_01_di" bpmnElement="Activity_first_01">
        <dc:Bounds x="360" y="230" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_03u79xd_di" bpmnElement="Flow_03u79xd">
        <di:waypoint x="288" y="270" />
        <di:waypoint x="360" y="270" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>`;
};
